export const empty = '';

export const throttle = (fn: any, wait: number): ((args: any) => void) => {
  let timer: NodeJS.Timer | null = null;
  return (...args: any): void => {
    if (!timer) {
      timer = setTimeout((): void => {
        if (fn) {
          fn(...args);
        }
        timer = null;
      }, wait);
    }
  };
};
